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 jdbc and odbc?

936


How can I get or redirect the log used by DriverManager and JDBC drivers?

937


What is ODBC and JDBC? How do you connect the Database?

1042


What is jdbc connection?

1089


What is ojdbc14 jar?

916


Why resultset is used in java?

939


What is the JDBC syntax for using a literal or variable in a standard Statement?

996


Can we return resultset in java?

933


Does sql allow null values ? Can we use it within where clause ?

982


What is jdbc? Describe the steps needed to execute a sql query using jdbc.

936


Does jdbc use ssl?

939


What is database deadlock ? How can we avoid them?

1058


How we can you use preparedstatement.

969


Briefly tell about the jdbc architecture.

999


How do we load the drivers?

1000