Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

MY code is: public class P1{
public static void main(String ar[])
{
class.forName("java.lang.String");
}
}
errors i got are :New.java:5: error: <identifier> expected
class.forName("java.lang.String");
^
New.java:5: error: invalid method declaration; return type
required
class.forName("java.lang.String");
^
New.java:5: error: illegal start of type
class.forName("java.lang.String");
^
New.java:7: error: reached end of file while parsing
}
^
4 errors
HELP ME>......

Answer Posted / siva mukesh

I think first error is...
1.Here in class name is Class.So we have to write Class.forName...(C caps)
2.forName() is used to register Driver.we have to specify any one of four drivers.

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If you are given a choice to implement the code to either insert a record or update if already exist, which approach will you follow ?

957


How to get the Database server details in java program?

1030


Can I use JDBC to execute non-standard features that my DBMS provides?

950


Explain about the Try Block?

939


password, is stored in as plain text. What can I do to protect my passwords?

918


What are the new features added to JDBC 4.0?

923


What is the reason why we need a jdbcrowset like the wrapper around resultset?

940


How are jdbc statements used?

908


How to connect html page to database using jdbc?

856


What is the use of getGeneratedKeys() method in Statement?

975


Why resultset is used in java?

899


Explain the difference between rowset vs. Resultset in jdbc?

957


Under what circumstances, that all four drivers are used?

2379


What are the basic exceptions in jdbc?

1048


What is jdbc databasemetadata interface?

1009