•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 373,375 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,802 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 467 | Replies: 7
![]() |
•
•
Join Date: Mar 2008
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
hai
i am nireekshan;
i am using Mysql 5.0;
it was instaling C:\Program Files\MySQL;
i am write code Bellow see and
--save c:\ "Mysqlcon.java " in this program
run-in commend Fromt> javac Mysqlcon.java It was NOT Any Errer;
>java Mysqlcon
ERRER ACCERED.......CLASS NOT FOUND EXPATION
//I AM COPY Mysql.jar file in C:\
i am nireekshan;
i am using Mysql 5.0;
it was instaling C:\Program Files\MySQL;
i am write code Bellow see and
--save c:\ "Mysqlcon.java " in this program
run-in commend Fromt> javac Mysqlcon.java It was NOT Any Errer;
>java Mysqlcon
ERRER ACCERED.......CLASS NOT FOUND EXPATION
//I AM COPY Mysql.jar file in C:\
java Syntax (Toggle Plain Text)
import java.sql.*; public class Mysqlcon{ public static void main(String[] args) { System.out.println("MySQL Connect Example."); Connection conn = null; String url = "jdbc:mysql://localhost:3306/"; String driver = "com.mysql.jdbc.Driver"; String userName = ""; String password = ""; try { Class.forName(driver).newInstance(); conn = DriverManager.getConnection(url,userName,password); System.out.println("Connected to the database"); conn.close(); System.out.println("Disconnected from database"); } catch (Exception e) { e.printStackTrace(); } } }
Last edited by peter_budo : Apr 1st, 2008 at 7:01 am. Reason: Keep It Organized - please use [code] tags
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,026
Reputation:
Rep Power: 8
Solved Threads: 227
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 1,897
Reputation:
Rep Power: 9
Solved Threads: 216
@nireekshan - your post is moved to Java section of forum
@na33n and others - if you find post to be in wrong section of the forum, just click on Flag Bad Post and type something like Please move this post to Java forum for example and moderators will deal with it
Thank you
@na33n and others - if you find post to be in wrong section of the forum, just click on Flag Bad Post and type something like Please move this post to Java forum for example and moderators will deal with it
Thank you
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,026
Reputation:
Rep Power: 8
Solved Threads: 227
Okay ! I thought flag bad post was to notify the moderators that the post has violated the rules. Thanks for clarifying !
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 1,897
Reputation:
Rep Power: 9
Solved Threads: 216
Flag Bad Post is marking a post if something is not in order from spam, wrong forum, request for help through email or phone, basicly anything what may be in your opinion against forum rules. Once we recieve report, we check it and make decision
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,026
Reputation:
Rep Power: 8
Solved Threads: 227
oh cool ! Will do that in future.. Cheers man!
Hey, I saw this in "Flag bad post" !
Hey, I saw this in "Flag bad post" !
•
•
•
•
Note: This is ONLY to be used to report spam, advertising messages, and problematic (harassment, fighting, or rude) posts.
Last edited by nav33n : Apr 1st, 2008 at 7:44 am.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
•
•
hai
i am nireekshan;
i am using Mysql 5.0;
it was instaling C:\Program Files\MySQL;
i am write code Bellow see and
--save c:\ "Mysqlcon.java " in this program
run-in commend Fromt> javac Mysqlcon.java It was NOT Any Errer;
>java Mysqlcon
ERRER ACCERED.......CLASS NOT FOUND EXPATION
//I AM COPY Mysql.jar file in C:\
Try running it with
java -cp .;mysql-connector-java-[ver]-bin.jar Mysqlcon. You need to have the jar file in your classpath for it to find the files.You may want to read this documentation as well: http://dev.mysql.com/doc/refman/5.0/...classpath.html
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,026
Reputation:
Rep Power: 8
Solved Threads: 227
•
•
•
•
Try running it withjava -cp .;mysql-connector-java-[ver]-bin.jar Mysqlcon. You need to have the jar file in your classpath for it to find the files.
You may want to read this documentation as well: http://dev.mysql.com/doc/refman/5.0/...classpath.html
[offtopic] Hi "Featured poster" of the month
[/offtopic] Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
age amd avatar backup blue gene breach business c++ chips daniweb data data protection database development dos economy energy enterprise europe government hacker hardware hp ibm ibm. news it linux medicine memory microsoft mmorpg mysql news ogre open source openoffice pc pirate ps3 recession red hat security server sun supercomputer supercomputing technology trends ubuntu x86
- How To Connect Remote Mysql Database (Visual Basic 4 / 5 / 6)
- can i use mysql database with asp (ASP)
- Need a good MySQL Database guy (Web Development Job Offers)
- copying mssql database on my local machine to a mysql database online (MySQL)
- Php code confusion. Not sure how to describe (PHP)
- URGENT: UBBThreads MySQL database merge (MySQL)
- Backing up a MySQL database (MySQL)
- Update entire Mysql DataBase with PhP (PHP)
Other Threads in the Java Forum
- Previous Thread: How to save a file in database and get the content from that file(using java)
- Next Thread: Temperature Conversion Applet



Linear Mode