getting mysql-data with jconnector

From: codemaster (jod_at_doe.com)
Date: 12/17/04


Date: Fri, 17 Dec 2004 17:09:36 +0200

what should i put to the getData() method to get some data?

public class Jdbctesti {
 public static void main(String[] args) {
  try {
   Class.forName("com.mysql.jdbc.Driver").newInstance();
   Connection conn = DriverManager.getConnection("jdbc:mysql://host");
   getData();
  } catch (Exception ex) {
   ex.printStackTrace();
  }
 }

 public static void getData() {
  // prints SELECT-result to command line
 }
}



Relevant Pages

  • Re: [Newbie] Reading & Writing Objects To File
    ... | java.io.StreamCorruptedException exception. ... |>> public static void main(Stringargs) ... |>> new CardCreatorDump(); ...
    (microsoft.public.dotnet.vjsharp)
  • Re: crushing java
    ... your reaction just proved you to be sentimental and self blinded ... public static void Main(stringargs) ... }catch(Exception e) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: crushing java
    ... your reaction just proved you to be sentimental and self blinded ... public static void Main(stringargs) ... }catch(Exception e) ...
    (microsoft.public.dotnet.framework)
  • Re: I need to know if a java class import a package
    ... to test if they can iterate an order an array by themselves). ... public static void main(Stringargs) throws Exception { ...
    (comp.lang.java.programmer)
  • Re: problem...sorry my first time with java
    ... public static void main{ ... java cl_gm ... the String array passed to the main method as args[] will be empty, ... You may wish to familiarise yourself with the javadoc for the exception ...
    (comp.lang.java.help)