hello friends.i have a problem on applet.i didnt teach database exactly.my english is bad.called as so sory friends.i can take data from mysql via eclipse.but i cant take data from mysql via html(localhost:).thank you friends .
Printable View
hello friends.i have a problem on applet.i didnt teach database exactly.my english is bad.called as so sory friends.i can take data from mysql via eclipse.but i cant take data from mysql via html(localhost:).thank you friends .
Are there any error messages? Look in the browser's java console.
Copy and paste them here.
no.i didnt take any error mssages on eclipse. i cant see error messages on firefox
What messages are in the java console?
Do all the catch blocks in the code call the printStackTrace() method?
com.mysql.jdbc.JDBC4ResultSet@ad89ecinit(): messages in ECLİPSE
other hand my code :
Code:public void baglantiAc() throws Exception {
String query="select * from kullanici";
Class.forName("com.mysql.jdbc.Driver");
baglanti=DriverManager.getConnection("jdbc:mysql://localhost/egitim","root","123456");
Statement statement=baglanti.createStatement();
if (baglanti == null){
System.out.print("Bağlanti sağlanamadi");
}
ResultSet result=statement.executeQuery(query);
ResultSetMetaData meta=result.getMetaData();
for(int i=1;i<=meta.getColumnCount();i++)
System.out.printf( "%-8s\t", meta.getColumnName( i ) );
System.out.println();
while(result.next())
{
int k=1;
id=String.valueOf(result.getObject(k));
k++;
kullanici=String.valueOf(result.getObject(k));
k++;
pass=String.valueOf(result.getObject(k));
k++;
okul=String.valueOf(result.getObject(k));
k++;
yas=String.valueOf(result.getObject(k));
}
System.out.print(result);
}
If you do not get an error message, there is no way to know what the problem is.
Add a println("Applet started") to your code that you will see on the java console and know that the program is executing.
What messages are in the browser's java console?
hmm. so i get null value of a String data.
Do you understand your problem now?
so so.thank you :):) Thank you for your help...
hoş geldiniz
:) hoş bulduk
what are errors this:
Detected from bootclasspath: C:\\PROGRA~1\\Java\\jre7\\lib\\deploy.jar
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(U nknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at ayy.init(ayy.java:37)
at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter .init(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The Class.forName() method can not find the class it is trying to load.Quote:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
..
at java.lang.Class.forName(Unknown Source)
at ayy.init(ayy.java:37)
You need to find the jar file with this class: com.mysql.jdbc.Driver and put it on the classpath so the java program can find it.
There must be an error message. You are missing it somehow.