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>......

Answers were Sorted based on User's Feedback



MY code is: public class P1{ public static void main(String ar[]) { ..

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

MY code is: public class P1{ public static void main(String ar[]) { ..

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

MY code is: public class P1{ public static void main(String ar[]) { ..

Answer / salman

public class P1
{
public static void main(String args[])
{
try
{
Class.forName("java.lang.String");
}catch(Exception ex){}
}
}

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More JDBC Interview Questions

How to move the cursor in scrollable resultset ?

0 Answers  


What types of DataSource objects are specified in the Optional Package?

0 Answers  


Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?

0 Answers  


what happens if connection is not closed?

7 Answers   CTS,


What is JDBC?

3 Answers   Akamai Technologies,


How many packages are available in jdbc api?

0 Answers  


What does executeupdate return in jdbc?

0 Answers  


What are the differences between execute, executequery, and executeupdate?

0 Answers  


Is it possible to connect to multiple databases? Using single statement can we update or extract data from two or three or many databases?

0 Answers  


What does adapter class provide?

0 Answers  


What are the basic exceptions in jdbc?

0 Answers  


can we define indexes on a foreign key? Explain pros and cons?

1 Answers  


Categories