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 / khasim

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 ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of drivers under jdbc?

853


How can you load the drivers?

973


What are the steps to connect to the database in java?

982


What is the benefit of having jdbcrowset implementation? Why do we need a jdbcrowset like wrapper around resultset?

961


What are the different types of locking in JDBC?

1015


How do I start debugging problems related to the JDBC API?

1030


How to test jdbc connection to sql server?

1028


Why hibernate is better than jdbc?

936


How many types of jdbc drivers are there?

996


How many categories of jdbc drivers are there?

917


What do you mean by batch processing in jdbc?

1011


Is jdbc faster than hibernate?

999


What is the difference between ojdbc6 and ojdbc7?

885


In which ways is driver class is registered with drive manager?

927


What is the return type of class.forname() method?

949