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

What is a statement in java?

886


What do you mean by jdbc batch processing and what are the advantages of using jdbc batch processing?

983


How does a file store compare with a jdbc store?

1187


What is SQL Warning? How to retrieve SQL warnings in the JDBC program?

1037


Does jdbc require oracle client?

924


Which interface handles transaction management in jdbc?

1095


Does jdbc use odbc?

996


How to move the cursor in scrollable resultset ?

1026


What causes the "No suitable driver" error?

1045


Does jpa use jdbc?

917


What is the role of class.forname while loading drivers?

1001


How can we set null value in jdbc preparedstatement?

960


What is jdbc odbc driver?

1026


What is the use of jdbc api?

971


Explain how data flows from view to db and reverse

2043