Article View: borland.public.jbuilder.java.api
Article #512advise
From: Jos Walrave
Date: Tue, 15 Jul 2003 06:55
Date: Tue, 15 Jul 2003 06:55
61 lines
2975 bytes
2975 bytes
I am a newbie. I just created this java code, for which JBuilder 8
Enterprise generates when build the following message : " Could not find the
main class. Will exit program."
Can someone advise me on this and also on the runtime configuration settings
? I understand one can define a default setting regarding the purpose of
your code (application, etc.).
Here is my code so far:
------------------------------------------------- >
import java.sql.*;
class loadJdbc {
public static void main (String[] args) {
try {
// try/catch clause to handle exception conditions
Connection connection = null;
String driverName = "com.ddtek.jdbcx.sqlserver.SQLServerDriver"; //
DataDirect JDBC Driver
String serverName = "127.0.0.1";
String portNumber = "1433";
String mydb = "DatabaseName=BugTracking";
String mydatabase = serverName + ":" + portNumber + ";" + mydb;
String url = "jdbc:datadirect:sqlserver://" + mydatabase; // DataDirect
JDBC URL (see page 19 jdbcref)
String username = "";
String password = "";
// Load the JDBC driver
Class.forName(driverName);
// Create connection to db
connection = DriverManager.getConnection(url,username,password);
// Create a result set containing all data from tblPermissions
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM tblPermissions");
// Fetch each row from the result set
while (rs.next()) {
// Get the data from the row using the column index
String s = rs.getString(1);
s = rs.getString("userID");
System.out.println(s);
}
}
catch (ClassNotFoundException e) {
// Couldn't find the db driver
}
catch (SQLException e) {
// Couldn't connect to the db
}
}
}
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.501 / Virus Database: 299 - Release Date: 7/14/2003
Technical Details
Message-ID:
<bf08fc$f0b$1@news2.tilbu1.nb.home.nl>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!skynet.be!skynet.be!213.51.129.3.MISMATCH!newshub1.home.nl!home.nl!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,e2f00e7674083998,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2003-07-14 23:56:09 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!skynet.be!skynet.be!213.51.129.3.MISMATCH!newshub1.home.nl!home.nl!not-for-mail From: "Jos Walrave" <coolsysjw@home.nl> Newsgroups: borland.public.jbuilder.java.api Subject: advise Date: Tue, 15 Jul 2003 08:55:27 +0200 Organization: @Home Benelux Lines: 63 Message-ID: <bf08fc$f0b$1@news2.tilbu1.nb.home.nl> NNTP-Posting-Host: cp138450-a.roose1.nb.home.nl X-Trace: news2.tilbu1.nb.home.nl 1058252076 15371 213.51.161.117 (15 Jul 2003 06:54:36 GMT) X-Complaints-To: abuse@home.nl NNTP-Posting-Date: Tue, 15 Jul 2003 06:54:36 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106