Results 1 to 15 of 15
  1. #1
    papyon is offline Member
    Join Date
    Dec 2011
    Posts
    13
    Rep Power
    0

    Default My database dont working on html in Applet

    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 .

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default Re: My database dont working on html in Applet

    Are there any error messages? Look in the browser's java console.
    Copy and paste them here.

  3. #3
    papyon is offline Member
    Join Date
    Dec 2011
    Posts
    13
    Rep Power
    0

    Default Re: My database dont working on html in Applet

    no.i didnt take any error mssages on eclipse. i cant see error messages on firefox

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default Re: My database dont working on html in Applet

    What messages are in the java console?

    Do all the catch blocks in the code call the printStackTrace() method?

  5. #5
    papyon is offline Member
    Join Date
    Dec 2011
    Posts
    13
    Rep Power
    0

    Default Re: My database dont working on html in Applet

    com.mysql.jdbc.JDBC4ResultSet@ad89ecinit(): messages in ECLİPSE

    other hand my code :
    Java 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);
    	
    
       }
    Last edited by Norm; 02-09-2012 at 05:43 PM. Reason: added code tags

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default Re: My database dont working on html in Applet

    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?

  7. #7
    papyon is offline Member
    Join Date
    Dec 2011
    Posts
    13
    Rep Power
    0

    Default Re: My database dont working on html in Applet

    hmm. so i get null value of a String data.

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default Re: My database dont working on html in Applet

    Do you understand your problem now?

  9. #9
    papyon is offline Member
    Join Date
    Dec 2011
    Posts
    13
    Rep Power
    0

    Default Re: My database dont working on html in Applet

    so so.thank you :):) Thank you for your help...

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default Re: My database dont working on html in Applet

    hoş geldiniz

  11. #11
    papyon is offline Member
    Join Date
    Dec 2011
    Posts
    13
    Rep Power
    0

    Default Re: My database dont working on html in Applet

    :) hoş bulduk

  12. #12
    papyon is offline Member
    Join Date
    Dec 2011
    Posts
    13
    Rep Power
    0

    Default Re: My database dont working on html in Applet

    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)

  13. #13
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default Re: My database dont working on html in Applet

    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    ..
    at java.lang.Class.forName(Unknown Source)
    at ayy.init(ayy.java:37)
    The Class.forName() method can not find the class it is trying to load.
    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.

  14. #14
    Alstair is offline Member
    Join Date
    Feb 2012
    Posts
    3
    Rep Power
    0

    Default Re: My database dont working on html in Applet

    There must be an error message. You are missing it somehow.

  15. #15
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: My database dont working on html in Applet

    Quote Originally Posted by Alstair View Post
    There must be an error message. You are missing it somehow.
    Read the whole thread before posting a response. The error message/trace is at #12.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. applet working in applet viewer, not browser
    By plasticfood in forum Java Applets
    Replies: 4
    Last Post: 06-24-2011, 06:47 PM
  2. Applet in Html
    By durduman in forum New To Java
    Replies: 10
    Last Post: 02-06-2011, 03:17 PM
  3. HTML Links on IzPack HTMLInfoPanel not working correctly
    By salman.kagzi in forum New To Java
    Replies: 0
    Last Post: 11-30-2010, 05:07 PM
  4. Replies: 1
    Last Post: 08-22-2010, 09:37 AM
  5. database-html/jsp
    By java_on_fire in forum New To Java
    Replies: 7
    Last Post: 03-18-2010, 01:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •