Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Java - Mysql problem

  Asked By: Clifton    Date: Mar 09    Category: Java    Views: 611
  

My query may look silly to u but i am
struggling with it from last 3 days.

2 queries are there....

1. I have some java program which i made on windos OS(with access
DB) , now i transfered a the files to linux Os and the new DB is
mysql.

Since i changed the database i have changed the driver and
conection string... i am not able to compile the program on linux OS.
it says

#javac Server1.java
Server1.java:1: The source file encoding may be different with this
platform enc
oding. Please use -encoding option to adjust file encoding, or apply
native2asci
i utility to make source file ASCII encoding.

I tried
#dos2unix Server1.java Server1.java
But the error remains on compilation.

I also opened the Server1.java file with vi editor and made

:set ff=unix <enter>
:x
But error remains...

How do i compile my program...

2 problem..

I used the following statement to load the driver and connect to the
database..whether they are correct...

import java.sql.*;

Class.forName("com.mysql.jdbc.Driver" ).newInstance();

Connection conn=DriverManager.getConnection
("jdbc:mysql://164.100.147.32:3306/chat?user=root&password=mysql");


When compiping the same program on WIndows OS with mysql as DB i got
exception Classnot foundexception:com.mysql.jdbc.Driver

How do i include the com.mysql... class into my package...

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Java - Mysql problem Or get search suggestion and latest updates.




Tagged: