Click here to Skip to main content
15,889,266 members
Home / Discussions / Java
   

Java

 
GeneralRe: how to set thread affinity in JAVA Pin
427748026-Sep-09 0:05
427748026-Sep-09 0:05 
QuestionNeed help with hash table Pin
snssewell24-Sep-09 22:21
snssewell24-Sep-09 22:21 
AnswerRe: Need help with hash table Pin
427748025-Sep-09 0:39
427748025-Sep-09 0:39 
GeneralRe: Need help with hash table Pin
snssewell25-Sep-09 19:30
snssewell25-Sep-09 19:30 
QuestionRead SDF using Java Pin
jason975424-Sep-09 21:30
jason975424-Sep-09 21:30 
AnswerRe: Read SDF using Java Pin
427748025-Sep-09 0:36
427748025-Sep-09 0:36 
GeneralRe: Read SDF using Java Pin
jason975425-Sep-09 4:12
jason975425-Sep-09 4:12 
GeneralRe: Read SDF using Java Pin
427748025-Sep-09 8:25
427748025-Sep-09 8:25 
If you have set up SQL server correctly then your code should run without any problems.

Try this and tell me what you get

import java.sql.*;

public class testConnection
{
    public static void main(String[] args) 
    {
        DB db = new DB();
        db.dbConnect("jdbc:jtds:sqlserver://localhost:1433/tempdb","sa","");
    }
}

class DB
{
    public DB() {}

    public voidn dbConnect(String db_connect_string, 
  String db_userid, String db_password)
    {
        try
        {
            Class.forName("net.sourceforge.jtds.jdbc.Driver");
            Connection conn = DriverManager.getConnection(
    db_connect_string, db_userid, db_password);
            System.out.println("connected");
            
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
};

GeneralRe: Read SDF using Java Pin
jason975425-Sep-09 23:47
jason975425-Sep-09 23:47 
GeneralRe: Read SDF using Java Pin
427748026-Sep-09 1:32
427748026-Sep-09 1:32 
GeneralRe: Read SDF using Java Pin
David Skelly28-Sep-09 22:29
David Skelly28-Sep-09 22:29 
QuestionJava Graphics and Desktop Pin
sharkbc24-Sep-09 17:45
sharkbc24-Sep-09 17:45 
AnswerRe: Java Graphics and Desktop Pin
427748024-Sep-09 18:51
427748024-Sep-09 18:51 
GeneralRe: Java Graphics and Desktop Pin
sharkbc24-Sep-09 19:48
sharkbc24-Sep-09 19:48 
GeneralRe: Java Graphics and Desktop Pin
sharkbc24-Sep-09 20:27
sharkbc24-Sep-09 20:27 
GeneralRe: Java Graphics and Desktop Pin
427748025-Sep-09 0:34
427748025-Sep-09 0:34 
GeneralRe: Java Graphics and Desktop [modified] Pin
sharkbc25-Sep-09 15:55
sharkbc25-Sep-09 15:55 
QuestionJ2ME Pin
Matt Cavanagh24-Sep-09 9:51
Matt Cavanagh24-Sep-09 9:51 
AnswerRe: J2ME Pin
427748024-Sep-09 18:50
427748024-Sep-09 18:50 
Questionplz help in java question Pin
arifihsan24-Sep-09 0:35
arifihsan24-Sep-09 0:35 
AnswerRe: plz help in java question Pin
Richard MacCutchan24-Sep-09 1:21
mveRichard MacCutchan24-Sep-09 1:21 
AnswerRe: plz help in java question Pin
427748024-Sep-09 3:37
427748024-Sep-09 3:37 
QuestionLUCKY DRAW system Pin
syarizan23-Sep-09 23:03
syarizan23-Sep-09 23:03 
AnswerRe: LUCKY DRAW system Pin
Richard MacCutchan24-Sep-09 1:22
mveRichard MacCutchan24-Sep-09 1:22 
AnswerRe: LUCKY DRAW system Pin
427748024-Sep-09 2:58
427748024-Sep-09 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.