| Problem with JDBC-ODBC connection to MS Access 2000 |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- Writing and running files from a Java/AspectJ application.I'm creating an add-on to windows that will let me create files and run
basic functions such a image editing, both built in and on the hard
drive of a ftp server. If anyone could help me it would be wonderful.
I am planning to use the Eclispe SDK woth the AspectJ plugin. I have
the basic functions set up word editing but I need to know how to run
.exe files on the hard drive.
- 2
- 2 level RAMAt some it will be economic to create banks of say 10 gigabytes of
RAM. This ram will be slower than regular RAM, but won't lose its
value when the power is ostensibly off.
How will this be integrated into Java?
The Windows world will likely treat these as small disk drives. You
will be able to manually place important files there. Windows will
fill it with something useless like system recovery snapshots.
However, it could be used more cleverly.
1. as a cache, much like the old Univac 1106 migrated files between
various speeds of mass storage in order to keep the most commonly used
ones on the fastest devices. You might even, like the 1106 unify this
with backup, so all files got backed up to servers on the Internet, or
spilled there if the disk became full.
2. for large address spaces, to keep infrequently used objects. It
becomes like your swap file today.
3. something else.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
- 2
- 3
- SPOT smart sensorsFor anyone interested in these but could never get the willpower to
learn embedded C or somesuch arcane language, these kits from Sun just
came out:
http://www.sunspotworld.com/products/
Some info:
http://www.sunspotworld.com/docs/
I had tinkered around with these typrs of objects before, but having
the thing programmable in Java makes the entire thing easier on my
end :-)
- 3
- 3
- storing SecretKey in keystorehi
i created a keystore as below
public static void makeKeyStore(){
try{
KeyStore ks=KeyStore.getInstance(KeyStore.getDefaultType());
ks.load(null,"".toCharArray());
FileOutputStream ksout=new FileOutputStream("myks.keystore");
char[] password = new char[] {'m','y','n','a','m','e'};
ks.store(ksout, password);
Arrays. fill(password, '\u0000' ) ;
}
catch(Exception e){
e.printStackTrace();
}
}
then i tried to store a generated key using an alias
public static void putEntriestoKS(){
try{
KeyStore ks=KeyStore.getInstance(KeyStore.getDefaultType());;
FileInputStream fin=new FileInputStream("myks.keystore");
char[] password = new char[] {'m','y','n','a','m','e'};
ks.load(fin,password);
FileOutputStream fout=new FileOutputStream("myks.keystore");
KeyGenerator kg=KeyGenerator.getInstance("AES");
SecretKey skey=kg.generateKey();
ks.setKeyEntry("mysecretkey", skey, password,null);
ks.store(fout,password);
Arrays.fill(password,'\u0000');
}
catch(Exception e){
e.printStackTrace();
}
}
when i run this i am getting a java.security.KeyStoreException: Cannot
store non-PrivateKeys
How then can i store SecretKey ?Do i have to use another provider?can
someone explain?
thanks
Jim
- 5
- why call cipher.getInstance(),throw below error?my source code is:
Security.addProvider(new BouncyCastleProvider());
Cipher cipher = Cipher.getInstance("RSA/NONE/PKCS1PADDING","BC");
when run it , cause below error,who can explain it,thanks in
advance.....
java.lang.ExceptionInInitializerError
at java.lang.Class.runStaticInitializers(Unknown Source)
at javax.crypto.Cipher.a(Unknown Source)
at javax.crypto.Cipher.getInstance(Unknown Source)
at
com.pioneer.bluray.security.authenticator.SignatureChecking.rsaDecrypt(Unknown
Source)
at
com.pioneer.bluray.security.authenticator.SignatureChecking.fetchSignature(Unknown
Source)
at
com.pioneer.bluray.security.authenticator.SignatureChecking.checkCredentialValues(Unknown
Source)
at
com.pioneer.bluray.security.authenticator.SignatureChecking.checkCredentials(Unknown
Source)
at
com.pioneer.bluray.security.authenticator.DVBSecUtils.invokeSecurity(Unknown
Source)
at org.dvb.lang.DVBClassLoader.securityCheck(Unknown Source)
at org.dvb.lang.DVBClassLoader.acquireData(Unknown Source)
at org.dvb.lang.DVBClassLoader.defineClassPrivileged(Unknown
Source)
at org.dvb.lang.DVBClassLoader.access$000(Unknown Source)
at org.dvb.lang.DVBClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Unknown Source)
at org.dvb.lang.DVBClassLoader.findClass(Unknown Source)
at org.dvb.lang.DVBClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.sun.tv.Request.execReq(Unknown Source)
at com.sun.tv.XletRunnable$ExecThread.run(Unknown Source)
at java.lang.Thread.startup(Unknown Source)
Caused by: java.lang.SecurityException: Cannot set up certs for
trusted CAs
at javax.crypto.SunJCE_b.<clinit>(Unknown Source)
... 20 more
Caused by: java.lang.SecurityException: Jurisdiction policy files
are not signed by trusted signers!
at javax.crypto.SunJCE_b.f(Unknown Source)
at javax.crypto.SunJCE_b.e(Unknown Source)
at javax.crypto.SunJCE_s.run(Unknown Source)
at java.security.AccessController.doPrivileged(Unknown Source)
at java.security.AccessController.doPrivileged(Unknown Source)
... 21 more
- 6
- Client/Server chat program - wait for connectionHi,
I'm trying to modify a client/server chat program that connects
immediately, to wait till an IP address is selected from a combo box and
then connect when a connect button is pressed. The combo box is loaded
from a file of IP addresses and I select the localhost address of
127.0.0.1.
I've taken out the app.runClient line from the main class and made it
the actionPerformed when the connect button is pressed, but the client
side seems to go dead (won't accept any input) when I do this although
the connection seems to be working.
Any help appreciated.
// Client.java
// Set up a Client that will read information sent
// from a Server and display the information.
import java.io.*;
import java.net.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Client3 extends JFrame
{ private JTextField enter;
private JTextArea display;
private JButton connect, send;
private JComboBox selectIp;
ObjectOutputStream output;
ObjectInputStream input;
String message = "", address = "";
public Client3()
{
super( "Client" );
Container c = getContentPane();
JPanel northPanel = new JPanel();
northPanel.setLayout( new GridLayout( 2, 1, 3, 3 ) );
// Enter field and action listener
enter = new JTextField();
enter.setEnabled( false );
enter.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent e )
{
sendData( e.getActionCommand() );
}
}
);
northPanel.add( enter );
// Send button
send = new JButton("Send >");
send.addActionListener(
new ActionListener()
{
public void actionPerformed( ActionEvent e )
{
sendBtn( e.getActionCommand() );
}
}
);
northPanel.add( send );
c.add( northPanel, BorderLayout.NORTH );
// Dislay area
display = new JTextArea();
c.add( new JScrollPane( display ),
BorderLayout.CENTER );
JPanel southPanel = new JPanel();
southPanel.setLayout( new GridLayout( 1, 2, 3, 3 ) );
// SelectIP combobox, listener and item listener
selectIp = new JComboBox();
selectIp.addItemListener(
new ItemListener() {
public void itemStateChanged( ItemEvent evt )
{
if( evt.getSource() == selectIp )
if( evt.getStateChange() == ItemEvent.SELECTED )
address = (String) evt.getItem();
}
} );
southPanel.add( selectIp );
// Read file and load into combobox
try
{
BufferedReader inBuffer = new BufferedReader( new
FileReader("ipaddress.txt") );
String line = inBuffer.readLine();
while( line != null )
{
selectIp.addItem( line );
line = inBuffer.readLine();
}
inBuffer.close();
}
catch(IOException e)
{ System.out.println(e);
}
// Connect button
connect = new JButton( "Connect");
connect.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent e )
{
if( e.getSource() == connect )
{
runClient();
}
}
} );
southPanel.add( connect );
c.add( southPanel, BorderLayout.SOUTH );
setSize( 300, 300 );
show();
} // end Client constructor
public void runClient()
{ Socket client;
try {
// Step 1: Create a Socket to make connection.
display.setText( "Attempting connection\n" );
client = new Socket(
InetAddress.getByName( address ), 6000 );
display.setText( "Connected to: "+ address +
client.getInetAddress().getHostName() );
// Step 2: Get the input and output streams.
output = new ObjectOutputStream(
client.getOutputStream() );
output.flush();
input = new ObjectInputStream(
client.getInputStream() );
display.append( "\nGot I/O streams" );
// Step 3: Process connection.
enter.setEnabled( true );
do
{ try {
message = (String) input.readObject();
display.append( "\n" + message );
display.setCaretPosition(
display.getText().length() );
}
catch ( ClassNotFoundException cnfex ) {
display.append(
"\nUnknown object type received" );
}
} while ( !message.equals( "SERVER>>> quit" ));
// Step 4: Close connection.
display.append( "\nClosing connection.\n" );
output.close();
input.close();
client.close();
} // end try
catch ( EOFException eof ) {
System.out.println( "Server terminated connection" );
}
catch ( IOException e ) {
e.printStackTrace();
}
} // end runClient
// Action handler for Enter key
private void sendData( String s )
{
try {
message = s;
output.writeObject( "CLIENT>>> " + s );
output.flush();
display.append( "\nCLIENT>>>" + s );
}
catch ( IOException cnfex ) {
display.append(
"\nError writing object" );
}
} // end sendData
// Action handler for send button
private void sendBtn( String s )
{
try {
s = enter.getText();
output.writeObject( "SERVER>>> " + s );
output.flush();
display.append( "\nSERVER>>>" + s );
}
catch ( IOException cnfex ) {
display.append(
"\nError writing object" );
}
} // end sendBtn
// Main
public static void main( String args[] )
{
Client3 app = new Client3();
app.addWindowListener(
new WindowAdapter()
{
public void windowClosing( WindowEvent e )
{ System.exit( 0 );
}
}
);
// app.runClient();
} // end main
} // end Client Class
// Server.java
// Set up a Server that will receive a connection
// from a client, send a string to the client,
// and close the connection.
import java.io.*;
import java.net.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Server1 extends JFrame
{
private JTextField enter;
private JTextArea display;
ObjectOutputStream output;
ObjectInputStream input;
public Server1()
{
super( "Server" );
Container c = getContentPane();
enter = new JTextField();
enter.setEnabled( false );
enter.addActionListener(
new ActionListener()
{
public void actionPerformed( ActionEvent e )
{
sendData( e.getActionCommand() );
}
}
);
c.add( enter, BorderLayout.NORTH );
display = new JTextArea();
c.add( new JScrollPane( display ),
BorderLayout.CENTER );
setSize( 300, 300 );
show();
} // end Server constructor
public void runServer()
{
ServerSocket server;
Socket connection;
int counter = 1, optionPane;
try {
// Create a ServerSocket.
server = new ServerSocket( 6000, 100 );
while ( true )
{
// Wait for a connection.
display.setText( "Waiting for connection\n" );
connection = server.accept();
display.append( "Connection " + counter +
" received from: " +
connection.getInetAddress().getHostName() );
// Set input and output streams.
output = new ObjectOutputStream(
connection.getOutputStream() );
output.flush();
input = new ObjectInputStream(
connection.getInputStream() );
display.append( "\nGot I/O streams\n" );
// Process connection.
String message =
"SERVER>>> Connection successful\n";
output.writeObject( message );
output.flush();
enter.setEnabled( true );
do {
try {
message = (String) input.readObject();
display.append( "\n" + message );
display.setCaretPosition(
display.getText().length() );
}
catch ( ClassNotFoundException cnfex ) {
display.append(
"\nUnknown object type received" );
}
if( message.equals( "CLIENT>>> TRANSFER FILE?" ) )
{
optionPane = JOptionPane.showConfirmDialog((Component)
null, "Do you want to accept the file transfer",
"File Transfer", JOptionPane.YES_NO_OPTION );
if( optionPane == JOptionPane.YES_NO_OPTION )
{
output.writeObject( "PRESS 'SEND FILE' BUTTON" );
output.flush();
display.append( "\nWAITING FOR FILE" );
}
else
{
output.writeObject( "NO - Do not send file" );
output.flush();
display.append( "\nNO - Do not send file" );
}
}
} while ( !message.equals( "CLIENT>>> quit" ) );
// Close connection.
display.append( "\nUser terminated connection" );
enter.setEnabled( false );
output.close();
input.close();
connection.close();
++counter;
} // end while
} // end try
catch ( EOFException eof ) {
System.out.println( "Client terminated connection" );
}
catch ( IOException io ) {
io.printStackTrace();
}
} // end runServer
private void sendData( String s )
{
try {
output.writeObject( "SERVER>>> " + s );
output.flush();
display.append( "\nSERVER>>>" + s );
}
catch ( IOException cnfex ) {
display.append(
"\nError writing object" );
}
} // end sendData
public static void main( String args[] )
{
Server1 app = new Server1();
app.addWindowListener(
new WindowAdapter()
{
public void windowClosing( WindowEvent e )
{ System.exit( 0 );
}
}
);
app.runServer();
} // end main
} // end Server Class
- 6
- 8
- Having issues with context listener and netbeansI'm new to netbeans and the whole JSP world in general (i have
experience in j2me and the j2se). I basically wanted to test out the
listener functions.
I get no errors with the following code, however, i'm also not able to
'break' where i want to be able to and I have no output as I would
expect. Any suggestions would be great.
MyHttpSessionListener.java
-------------------------------------------------------------
package com.maturitymodel;
import javax.servlet.http.HttpSessionListener;
import javax.servlet.http.HttpSessionEvent;
public class MyHttpSessionListener implements HttpSessionListener
{
public void sessionCreated(HttpSessionEvent e)
{
System.err.println("Hello new session");
}
public void sessionDestroyed(HttpSessionEvent e)
{
System.err.println("ByeBye old session");
}
}
---------------------------------------------------------------------------
web.xml
--------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<listener>
<listener-class>com.maturitymodel.MyHttpSessionListener</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config><session-timeout>
30
</session-timeout></session-config><welcome-file-list><welcome-file>
index.jsp
</welcome-file></welcome-file-list></web-app>
-----------------------------------------------------------------------
index.jsp
------------------------------------------------------------------------
<%@ page session="true"%>
- 9
- Applet startup error - simple questionGreetings!
I am running into a very strange problem with a very simple code
In my html page I have the following code:
<applet codebase="/" code="InterApplet" width="400" height="150"
name="InterApplet">
<param name="OutFrame" value="outFrame" valuetype="object">
no support for java
</applet>
When I load the page on Windows 2000 machine running IE6 it works fine
- applet loads. However, when I try to open this page on a Windows XP
machine also running IE6 it can't find the applet "load: class
InterApplet not found". I have my custom built web server so I could
actually see that the browser did make a request for InterApplet.class
and web server has served it.
So what in the world is happening?!? This is very frustrating.
I have not done any serious java programming since '97...
Thanks for your time.
- 9
- Is this syntactically valid Java?Is the following syntactically valid?
public class Foo {
public static void main(String[] args) {
for( foo: ; ; ); // Note statement label
}
}
javac is rejecting this, but IntelliJ is saying that it is valid. I
would appreciate a reference to the JLS if possible, so I can file a
bug report either with Sun or with JetBrains.
--
C. Benson Manica | I appreciate all corrections, polite or otherwise.
cbmanica(at)gmail.com |
----------------------| I do not currently read any posts posted through
sdf.lonestar.org | Google groups, due to rampant unchecked spam.
- 10
- java.nio problemI had a NIO problem.
I tried to open a socket channel, and grep a HTML page from HTTP GET.
I did it success if I open and close socket channel everytime I send a
request and get the response.
However, if I keep open the socket channel and send multiple requests,
I'll get IOException.
Does anybody know how to solve this problem? Thanks in advance!
Note: I don't want to fire requests in parallel but one by one
sample code:
=============================================================
private Charset charset = Charset.forName("ISO-8859-1");
private SocketChannel channel;
try
{
// do connection
InetSocketAddress socketAddress =
new InetSocketAddress( "www.mydomain.com", 80);
channel = SocketChannel.open(socketAddress);
// send request #1
channel.write(charset.encode("GET /page1.html HTTP/1.0\r\n\r\n") );
// read response #1
ByteBuffer buffer = ByteBuffer.allocate(1024);
while ((channel.read(buffer)) != -1)
{
buffer.flip();
System.out.println(charset.decode(buffer));
buffer.clear();
}
// send request #2
channel.write(charset.encode("GET /page2.html HTTP/1.0\r\n\r\n") );
// read response #2
// program threw "java.io.IOException: Read failed" error
while ((channel.read(buffer)) != -1)
{
buffer.flip();
System.out.println(charset.decode(buffer));
buffer.clear();
}
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
if (channel != null)
{
try
{
channel.close();
} catch (IOException e) {}
}
}
=============================================================
- 10
- ports/77656: java/jdk15 - (AMD64) install problem.Synopsis: java/jdk15 - (AMD64) install problem.
State-Changed-From-To: open->feedback
State-Changed-By: linimon
State-Changed-When: Fri Mar 31 08:53:35 UTC 2006
State-Changed-Why:
Submitter: is this still a problem?
Responsible-Changed-From-To: phantom->freebsd-java
Responsible-Changed-By: linimon
Responsible-Changed-When: Fri Mar 31 08:53:35 UTC 2006
Responsible-Changed-Why:
Reassign from phantom since he has been inactive for more than one year.
Hat: gnats-admin
http://www.freebsd.org/cgi/query-pr.cgi?pr=77656
- 15
- java.lang.OutOfMemory ErrorI had used StringBuffer, as with 'out.println()' I will have to use +
operator for all the concatenation which I thought won't be that
efficient as using the StringBuffer.
|
| Author |
Message |
lmclaus

|
Posted: 2003-11-27 2:18:00 |
Top |
java-programmer, Problem with JDBC-ODBC connection to MS Access 2000
I am trying to use JDBC-ODBC bridge to connect to a Access 2000
database on a Windows 2000 machine. I have set up
the database using the Data Sources utility in Windows 2000. I am
using the Java(TM) 2 SDK, Standard Edition
Version 1.4.2_01. The code snippet from an example I found is:
import java.sql.*;
import javax.swing.JOptionPane;
public class BookDB{
private static Connection connection;
private static Statement scrollStatement;
private static ResultSet books;
public static void connect() throws ClassNotFoundException,
SQLException {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:MurachBooks";
String user = "Admin";
String password = "";
connection = DriverManager.getConnection(url, user, password);
}
When I complie I get the following error:
BookDB.java [10:1] cannot resolve symbol
symbol : method forName (java.lang.String)
location: class Class
try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
^
1 error
Errors compiling BookDB.
I have looked at all of the possible sources of information I can
think of to find an answer to my problem.
|
| |
|
| |
 |
Stefan Siegl

|
Posted: 2003-11-28 5:11:00 |
Top |
java-programmer >> Problem with JDBC-ODBC connection to MS Access 2000
I do not see any errors in the code. The same code will work fine for me
(there is no compile time error). Are you sure that you did not mess up
with the standard classpath?
lmclaus wrote:
> I am trying to use JDBC-ODBC bridge to connect to a Access 2000
> database on a Windows 2000 machine. I have set up
> the database using the Data Sources utility in Windows 2000. I am
> using the Java(TM) 2 SDK, Standard Edition
> Version 1.4.2_01. The code snippet from an example I found is:
>
> import java.sql.*;
> import javax.swing.JOptionPane;
>
> public class BookDB{
> private static Connection connection;
> private static Statement scrollStatement;
> private static ResultSet books;
>
> public static void connect() throws ClassNotFoundException,
> SQLException {
>
> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> String url = "jdbc:odbc:MurachBooks";
> String user = "Admin";
> String password = "";
> connection = DriverManager.getConnection(url, user, password);
> }
>
> When I complie I get the following error:
>
> BookDB.java [10:1] cannot resolve symbol
> symbol : method forName (java.lang.String)
> location: class Class
> try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> ^
> 1 error
> Errors compiling BookDB.
>
> I have looked at all of the possible sources of information I can
> think of to find an answer to my problem.
|
| |
|
| |
 |
lmclaus

|
Posted: 2003-11-28 21:52:00 |
Top |
java-programmer >> Problem with JDBC-ODBC connection to MS Access 2000
Stefan Siegl <email***@***.com> wrote in message news:<bq5p9c$1tpcbp$email***@***.com>...
> I do not see any errors in the code. The same code will work fine for me
> (there is no compile time error). Are you sure that you did not mess up
> with the standard classpath?
>
> lmclaus wrote:
>
> > I am trying to use JDBC-ODBC bridge to connect to a Access 2000
> > database on a Windows 2000 machine. I have set up
> > the database using the Data Sources utility in Windows 2000. I am
> > using the Java(TM) 2 SDK, Standard Edition
> > Version 1.4.2_01. The code snippet from an example I found is:
> >
> > import java.sql.*;
> > import javax.swing.JOptionPane;
> >
> > public class BookDB{
> > private static Connection connection;
> > private static Statement scrollStatement;
> > private static ResultSet books;
> >
> > public static void connect() throws ClassNotFoundException,
> > SQLException {
> >
> > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> > String url = "jdbc:odbc:MurachBooks";
> > String user = "Admin";
> > String password = "";
> > connection = DriverManager.getConnection(url, user, password);
> > }
> >
> > When I complie I get the following error:
> >
> > BookDB.java [10:1] cannot resolve symbol
> > symbol : method forName (java.lang.String)
> > location: class Class
> > try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> > ^
> > 1 error
> > Errors compiling BookDB.
> >
> > I have looked at all of the possible sources of information I can
> > think of to find an answer to my problem.
The classpath variable setting certainly may be a problem. I have been
confused by the instructions I have read on what I need to define for
various path settings and whether they need to be in a User or System
path variable.
|
| |
|
| |
 |
Bjorn Abelli

|
Posted: 2003-11-28 23:03:00 |
Top |
java-programmer >> Problem with JDBC-ODBC connection to MS Access 2000
"lmclaus" wrote...
> > > I am trying to use JDBC-ODBC bridge to connect to a Access 2000
> > > database on a Windows 2000 machine. I have set up
> > > the database using the Data Sources utility in Windows 2000. I am
> > > using the Java(TM) 2 SDK, Standard Edition
> > > Version 1.4.2_01. The code snippet from an example I found is:
>
> The classpath variable setting certainly may be a problem. I have been
> confused by the instructions I have read on what I need to define for
> various path settings and whether they need to be in a User or System
> path variable.
With that configuration you shouldn't need to have the classpath as an
environment variable at all.
// Bjorn A
|
| |
|
| |
 |
Stefan Siegl

|
Posted: 2003-11-29 9:46:00 |
Top |
java-programmer >> Problem with JDBC-ODBC connection to MS Access 2000
lmclaus wrote:
> Stefan Siegl <email***@***.com> wrote in message news:<bq5p9c$1tpcbp$email***@***.com>...
>
>>I do not see any errors in the code. The same code will work fine for me
>>(there is no compile time error). Are you sure that you did not mess up
>>with the standard classpath?
>>
>>lmclaus wrote:
>>
>>
>>>I am trying to use JDBC-ODBC bridge to connect to a Access 2000
>>>database on a Windows 2000 machine. I have set up
>>>the database using the Data Sources utility in Windows 2000. I am
>>>using the Java(TM) 2 SDK, Standard Edition
>>>Version 1.4.2_01. The code snippet from an example I found is:
>>>
>>>import java.sql.*;
>>>import javax.swing.JOptionPane;
>>>
>>>public class BookDB{
>>> private static Connection connection;
>>> private static Statement scrollStatement;
>>> private static ResultSet books;
>>>
>>> public static void connect() throws ClassNotFoundException,
>>>SQLException {
>>>
>>> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>>> String url = "jdbc:odbc:MurachBooks";
>>> String user = "Admin";
>>> String password = "";
>>> connection = DriverManager.getConnection(url, user, password);
>>> }
>>>
>>>When I complie I get the following error:
>>>
>>>BookDB.java [10:1] cannot resolve symbol
>>>symbol : method forName (java.lang.String)
>>>location: class Class
>>> try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>>> ^
>>>1 error
>>>Errors compiling BookDB.
>>>
>>>I have looked at all of the possible sources of information I can
>>>think of to find an answer to my problem.
>
>
>
> The classpath variable setting certainly may be a problem. I have been
> confused by the instructions I have read on what I need to define for
> various path settings and whether they need to be in a User or System
> path variable.
If you do not change the bootstrap ClassLoader of Java then all the
needed classes should be loaded automatically be the JVM. If you are not
completely sure if you change it, perhaps you can provide the command
you use to start your program.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Applet caching in IE5 - permanently!
I have the same problem and I posted the question a couple of weeks ago
but no one seemed to care or know what happened.
> -----Original Message-----
> From: email***@***.com (Dave) [SMTP:email***@***.com]
> Posted At: Wednesday, July 16, 2003 5:43 AM
> Posted To: comp.lang.java.programmer
> Conversation: Applet caching in IE5 - permanently!
> Subject: Applet caching in IE5 - permanently!
>
> IE seems to be caching applet classes forever. The 'CTRL-REFRESH'
> thing used to work (I've been doing that for years). But just recently
> (about 1 month ago), this stopped working. Deleting temporary files,
> restarting IE and even rebooting doesn't seem to flush the cache. I'm
> really confused - where could it be caching it?
>
> The only thing I can think of is that a 'Windows update' has installed
> an IE patch that has broken something.
>
> Has anyone else experienced this? Am I going mad?
- 2
- 3
- Change look of disabled JButtonHello
How can I change the look of a disabled JButton? I have made a boardgame
with a brown background and brown buttons. I have also put an imageicon on
the buttons that has a colored image on it. When I disable the buttons, the
colored image is turned into grey which screws up the look of my game.
Can I change the grey color on a disabled button? Or do I have to keep it
enabled, and attach another imageicon with different color to show the user
he can't click the button?
Also, I can sometimes see a blue/gray line around my buttons. I want to get
rid of it, so I guess it has something to do with setBorder, but I can't
find it.
Thx,
Oswald
- 4
- How often to get a reference to my cached bean?Hi I have an entity bean which caches data. It could sit in the
container for a very long time.
This entity bean has references to other similary beans that cache.
Should I get a single reference to the other beans once - on startup or
should I lookup the bean every time I need it?
MyClassHome refhome = MyHomeHelper.getHome();
MyCacheClass reference = refhome.find();
The only reason I can think of for looking it up may be if the resource
(bean) moved to another server due to a crash/failover etc?
thanks
Tim
- 5
- Stateless Session Beans and a Stateful Singleton? (Sharing dataI am interested in solving the same problem.
I currently have a solution involving JMX and WebLogic cluster.
1-create dynamic Mbean with synchronized methods
2-register with WL admin server as MBean agent/manager
3-all managed servers/users in cluster have access to this singleton
4-as clients log in/out they can invoke addUser/deleteUser methods on
dynamic mbean. They can also read currentUserCount.
PROBLEM:Single point of failure on admin server.
Looking for a simpler solution as you described above, OR
figuring out how to have dynamic MBean replicated in cluster so that each
managed server uses a local replicated copy--not sure how to achieve this
yet...
- 6
- Bug#348398: Make her horny for youThe real trophy for her is what lies in your pants.
http://www.Steiplas.com/
Please don't forget this
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 7
- Tomcat4 RMI class loading bermuda triangleHi every body,
I'm trying to fix this problem for one week and i'm turning crazy
right now.
I have this servlet working perfectly, finding every package i put in
/var/tomcat4/shared/lib except that it doesn't find my RMIServer class
for casting
i get a
[java.lang.ClassNotFoundException] - myRMIServerClass
org.apache.catalina.loader.StandardClassLoader.loadClass(Unknown
Source)
org.apache.catalina.loader.StandardClassLoader.loadClass(Unknown
Source)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:141)
all classes are in the jar with the stub and skeleton (i tried to put
classes in WEB_INF/classes of my servlet but same problem... so i
guess this is not the real problem)
I have set in catalina policy file a:
grant {
permission java.security.AllPermission;
};
to be sure there's no problem of security. i changed the
init.d/tomcat4 script to add -security to the starting line to be sure
that it is started the right way
i used to try the same code with tomcat 3 and i changed to tomcat 4
because of a rmi jni problem reported on mailing lists (i spent so
much time on tomcat4 that i can't remember what was the previous one)
but i can't even get that far with tomcat4
my version is a rpm 4.2.1 for Red Hat
does someone understand what's going on
- 8
- JPanel doenst growHey, I am beginning Java Student with a Java Problem. I looked on the
Internet but didn't find my answer anywhere, maybe you guys could help ?
I have a:
JFRAME --> Container+GridBayLayout
Container+GridBayLayout --> JPanel options
--> JScrollpanel
JScrollpanel --> add(new RectangleGroup());
//A piece of the entire class RectangleGroup:
-------------------
public class RectangleGroup extends JPanel
{
public void paintComponent(Graphics g)
{
this.g = g;
super.paintComponent(g);
//A lot of THESE Things
g.drawRect(150,100,100,10);
}
}
-------------------
The problem is that I dont get a scrollbar when I draw a rectangle that is
out of sight in the browser.
A have uploaded a picture of it here:
http://www.denbreejen.net/public/School/dnaproject2/browser_problem.gif
Wouter
--
Message posted via http://www.javakb.com
- 9
- CFP - IT Underground 2006, Prague, Czech RepublicHello,
I'd like to announce the call for papers for the IT Underground 2006, a
two-day conference organized by Software Conferences and hakin9.lab team in
23-24 February 2006, Prague, Czech Republic.
IT Underground 2006 is a fifth edition of a conference dedicated to IT
security issues, where remarkable authorities will share their knowledge and
experience with IT specialists.
In previous editions we had pleasure to listen to: Ofir Arkin, Maximillian
Dornseif, David h1kari Hulton, Chuck Willis, Charl Van der Walt, Shalom
Carmel, Martin Herfurt, Adam Laurie, Marcel Holtmann, Alexander Kornbrust,
Saumil Udayan Shah, Robert Lee Ayers, Dave Aitel, Stefano Zanero, Thorsten
Holz, Joanna Rutkowska, Michael Shema, Piotr Sobolewski, Michal Szymanski,
Paul Wouters, Rakan El-Khalil, Wojciech Dworakowski, K.K. Mookhey, Pawel
Krawczyk.
The dead line for lecture proposals is the 15th of January, 2006.
All the detailed information you can find on http://www.itUnderground.org/
We hope that you find our offer interesting. Please, contact me to discuss
further details of our cooperation.
IT Underground 2006 - basic characteristics.
When: 23-24 February 2006
Where: Prague, Czech Republic
Topic: IT Security
We assure:
- hotel accommodation and transfer,
- full support for your presentation, both before and during the conference,
- providing the necessary technical facilities for the presentation,
- assistance in acquiring and publishing presentation materials, information
about your lecture in the conference brochure,
- supervising and directing the overall progress of the conference.
--
Piotr Sobolewski
email***@***.com
- 10
- WSIF and format:typemapping questionsHi to all of you,
I have to use wsif to call java, ejb and jms bindings. I wonna use
<format:typeMapping> extension to convert from xml to my custom Java
object. But somehow I cann not. Samples in WSIF zip are not enough to
solve my problems. Could someone give good tutorial or share his/her
experiense.
10x jajoo :)
- 11
- struts: Multipage formHi,
I'm collection data across several pages using one Form per page. The scope of
each form is set to session. Let's say I have form1, form2 and form3 and the
corresponding action classes. In the jsp corresponding to form3 I can access
form1 using form1 as bean name.
But how can I access form1 from the Action class corresponding to form3?
Hope that was not to confusing.
Thanks in advance,
phi
- 12
- Cannot Find My API classThere goes the error:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 0 in the jsp file: /time.jsp
Generated servlet error:
[javac] Compiling 1 source file
F:\JAVA\TomCat41\work\Standalone\localhost\bigj\time_jsp.java:41:
cannot resolve symbol
symbol : class TimeFormatterBean
location: class org.apache.jsp.time_jsp
TimeFormatterBean formatter = null;
^
How can be seen, it cannot locate the TimeFormatterBean class. I've
placed my application in the dir:
%CATALINA_HOME%\webapps\bigj\
and the class in here:
%CATALINA_HOME%\webapps\bigj\WEB-INF\classes
so.. y dam it ain't working?
- 13
- Jruby and script loadingI am looking for different ways to load jruby scripts from java. Has
anyone been doing this. JRuby 1.0 and Java 1.6
Berlin Brown
- 14
- Tomcat classpath and servlets outside of WEB-INFHi,
Does anybody know if it is possible to execute servlets outside the
WEB-INF directory? Somebody at work thinks that setting the classpath
would help. But I have had no luck so far. I'm currently on a
Win2000 box running Apache, Tomcat 4.1.18, j2sdk 1.4.2. And I found
out (to my dismay) that symbolic linking doesn't work with Windows. I
don't even know if symbolic linking would work if it was a linux box.
People at work say that Tomcat has worked and it was executing
servlets outside the WEB-INF directory. They are very sure on this
point. But it broke, and they decided to deleted the entire
installation (conf file and all). And the person who got it to work
is no longer here. So I'm at square one. Jserv had been running the
servlets, but the company wants to move forward. The servlets had
been mapped to Jserv through the classpath.
Any help or ideas would be greatly appreciated.
Jim
- 15
- is it possible to use a backslash as a StringTokenizer delimiter?I am trying to tokenize a file path to compare it to another.
i.e tokenize: ways\gov\marketing.fls
to compare each directory seperately.
Is it possible to use the "\" (backslash) character as a StringTokenizer
delimiter, and if so how?
if not, any ideas on how to seperate this string?
Any help greatly appreciated
Thanks
Greenz
|
|
|